<?php


namespace App\common\Events;

use Illuminate\Broadcasting\Channel;
use Illuminate\Http\Request;
use Illuminate\Queue\SerializesModels;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\InteractsWithSockets;

class ThirdPartyLogin {
    use Dispatchable, InteractsWithSockets, SerializesModels;

    /**
     * Create a new event instance.
     * request          自带请求类
     * drive            通道
     * login_method     方式，WeChat=微信，Alipay=支付宝，QQ=QQ等
     * req_type         getCode codeGetInfo
     * login_type       app=APP  h5=JASAPI small=小程序
     * data             数据，req_type=callback时
     * login_method     方式，users=用户，store=商户
     */
    public function __construct($request, $drive, $login_method, $req_type, $login_type, $data,$platform) {
        $this->request = $request;
        $this->drive = $drive;
        $this->login_method = $login_method;
        $this->req_type = $req_type;
        $this->login_type = $login_type;
        $this->data = $data;
        $this->platform = $platform;

    }

    /**
     * Get the channels the event should broadcast on.
     *
     * @return Channel|array
     */
    public function broadcastOn() {
        return new PrivateChannel('channel-name');
    }
}
